home *** CD-ROM | disk | FTP | other *** search
/ Tech Arsenal 1 / Tech Arsenal (Arsenal Computer).ISO / tek-04 / 422mods.zip / BREEZ1A.422 < prev    next >
Text File  |  1993-02-22  |  8KB  |  252 lines

  1. 2{3BREEZ1A.MOD2} 0Keep Titles
  2. Mr. Breeze #6 @13651
  3. Thu Feb 18 15:05:52 1993
  4. ┌───────────────────────────╢ PLEASE USE THIS! ╟─────────────────────────────┐
  5. │ Mod Name    : BREEZE1A.MOD              Mod Author   : Mr. Breeze          │
  6. │ Difficulty  : ▓░░░░  Easy               WWIVLink     : 6 @ 13651           │
  7. │ Date        : February 18th, 1993       WWIVNet      : 6 @ 3651            │
  8. │                                         ICEnet       : 6 @ 3651            │
  9. │ WWIV version: 4.22, Probably previous too.                                 │
  10. │                                                                            │
  11. │ Description:  Keeps the title of the message or mail being replied to.     │
  12. │               Supports color in titles (as far as backspacing).            │
  13. └────────────────────────────────────────────────────────────────────────────┘
  14.  
  15. This mod was designed so that titles of like messages can be immediately
  16. recognized.  For example, if someone is using a QWK reader, he may have his
  17. titles alphabetized.  With this mod, all titles that pertain to the same
  18. subject will have the same title!
  19.  
  20. This mod will display and use the title of the message being responded to.
  21. This is like many QWK readers, and 'other' BBS software.  As written, it
  22. will prompt for a title like usual, though it will display the title of the
  23. message the user is responding to (with color if previous title had color).
  24. If the user hits 'Enter', the title display will be used for the post (or
  25. E-mail).  If a 'space' is entered by the user, then he will be able to
  26. "append" to the current title.  Any other key will backspace over the
  27. title that is displayed, and allow the user to enter his own title.
  28. This has built-in support for the Color Titles mod, so if you're not using it,
  29. you will want to delete the lines that are commented as /* Color Titles */.
  30.  
  31.  
  32. Find this block of code in MSGBASE.C 'void inmsg(blah..blah..)'
  33.  
  34.   nl();
  35.   helpl=6;
  36.   if (okansi()) {
  37.     prt(2,get_string(326));
  38.     mpl(60);
  39.     inputl(title,60);
  40.   } else {
  41.     pl(get_string(626));
  42.     outstr(get_string(326));
  43.     inputl(title,60);
  44.   }
  45.  
  46. And replace it with THIS block of code.
  47. (If your not using the color titles mod, delete the 3 lines indicated */
  48.  
  49.   if (needtitle) {                                 /* Begin BREEZE1A.MOD */
  50.     nl();
  51.     helpl=6;
  52.     sprintf(ro,"");                                      /* Color Titles */
  53.     if (irt[0]) {
  54.       prt(5,get_string(972));                                   /* Note */
  55.       nl();
  56.     } else {
  57.       prt(5,get_string(973));                                   /* Note */
  58.       nl();
  59.     }
  60.     if (okansi()) {
  61.       prt(2,get_string(326));  /*Title: */
  62.       mpl(60);
  63.       gtitle=1;                                          /* Color Titles */
  64.       if (irt[0]) {
  65.         prt(4,irt);
  66.         titlein(title,60);
  67.       } else
  68.         inputl(title,60);
  69.     } else {
  70.       pl(get_string(626));
  71.       outstr(get_string(326));  /*Title: */
  72.       gtitle=1;                                          /* Color Titles */
  73.       if (irt[0]) {
  74.         prt(4,irt);
  75.         titlein(title,60);
  76.       } else
  77.         inputl(title,60);
  78.     }
  79.   }                                                  /* End BREEZE1A.MOD */
  80.  
  81. Then load up COM.C (or NEW.C, or STRINGS.C, wherever you put new voids).
  82. Add these voids after 'void input1(...)' if in COM.C.
  83. (Yes, it's just a re-write of 'void input1(...)'.  Perhaps I'll optimize it
  84. in the future).
  85.  
  86. Note:  If your using Tolkien's ENHANCE.C, you already have 'int strlena(...)'.
  87.  
  88. int strlena(char *s)
  89. /* From Tolkien's ENHANCE.C
  90.  * 'strlena' function returns the length of a string WITHOUT color codes
  91.  */
  92. {
  93.  
  94.   int i=0,a=0;
  95.  
  96.   checkhangup();
  97.   if (!hungup)
  98.     while (s[i])
  99.       if (s[i++]==3)
  100.         i++;
  101.       else
  102.         a++;
  103.   return(a);
  104. }
  105.  
  106.  
  107. void titlein(char *s, int maxlen)
  108. /* BREEZE1A.MOD
  109.  * This will input a title, using 's1' as the default.
  110.  */
  111. {
  112.   char s1[81];
  113.   int curpos=0, done=0, in_ansi=0, i, rndm;
  114.   unsigned char ch;
  115.  
  116.   ansic(4);
  117.   i=strlena(irt);                         /* From Tolkien's ENHANCE.C */
  118.   while (!done && !hangup) {
  119.     ch = getkey();
  120.     if (curpos==0) {
  121.       if (ch==13) {
  122.         strcpy(s,irt);
  123.         nl();
  124.         break;
  125.       } else if (ch==26) {
  126.         s[0]=0;
  127.         nl();
  128.         break;
  129.       } else if (ch==32) {
  130.         curpos=i;
  131.         strcpy(s,irt);
  132.         strcat(s," ");
  133.       } else
  134.         while (i) {
  135.           i--;
  136.           backspace();
  137.         }
  138.     }
  139.     if (in_ansi) {
  140.       if ((in_ansi==1) && (ch!='['))
  141.         in_ansi=0;
  142.       else {
  143.         if (in_ansi==1)
  144.           in_ansi=2;
  145.         else if (((ch<'0') || (ch>'9')) && (ch!=';'))
  146.           in_ansi=3;
  147.         else
  148.           in_ansi=2;
  149.       }
  150.     }
  151.     if (!in_ansi) {
  152.       if (ch > 31) {
  153.         if (curpos < maxlen) {
  154.           s[curpos++] = ch;
  155.           outchr(ch);
  156.         }
  157.       } else
  158.         switch(ch) {
  159.           case 13:
  160.             s[curpos] = 0;
  161.             done = echo = 1;
  162.             nl();
  163.             break;
  164.           case 14: /* Ctrl-N */                     /* Color Titles */
  165.             if(gtitle) {                            /* Color Titles */
  166.               if ((wherex()) && (curpos<maxlen)) {  /* Color Titles */
  167.                 outchr(8);                          /* Color Titles */
  168.                 s[curpos++]=8;                      /* Color Titles */
  169.               }                                     /* Color Titles */
  170.              }                                      /* Color Titles */
  171.             break;                                  /* Color Titles */
  172.           case 16: /* Ctrl-P */                     /* Color Titles */
  173.             if(gtitle) {                            /* Color Titles */
  174.               if (curpos<maxlen-1) {                /* Color Titles */
  175.                  ch=getkey();                       /* Color Titles */
  176.                  if ((ch>='0') && (ch<='9')) {      /* Color Titles */
  177.                    s[curpos++]=3;                   /* Color Titles */
  178.                    s[curpos++]=ch;                  /* Color Titles */
  179.                    ansic(ch-'0');                   /* Color Titles */
  180.                  }                                  /* Color Titles */
  181.                }                                    /* Color Titles */
  182.              }                                      /* Color Titles */
  183.             break;                                  /* Color Titles */
  184.           case 23: /* Ctrl-W */
  185.             if (curpos) {
  186.               do {
  187.                 curpos--;
  188.                 backspace();
  189.                 if (s[curpos]==26)
  190.                   backspace();
  191.               } while ((curpos) && (s[curpos-1]!=32));
  192.             }
  193.             break;
  194.           case 26:
  195.             if (input_extern) {
  196.               s[curpos++] = 26;
  197.               outstr(get_string(307));  /*^Z*/
  198.             } else {
  199.               s[0]=0;
  200.               nl();
  201.               done=echo=1;
  202.             }
  203.             break;
  204.           case 8:
  205.             if (curpos) {
  206.               curpos--;
  207.               backspace();
  208.               if (s[curpos] == 26)
  209.                 backspace();
  210.             }
  211.             break;
  212.           case 21:
  213.           case 24:
  214.             while (curpos) {
  215.               curpos--;
  216.               backspace();
  217.               if (s[curpos] == 26)
  218.                 backspace();
  219.             }
  220.             break;
  221.           case 27:
  222.             in_ansi=1;
  223.             break;
  224.         }
  225.     }
  226.     if (in_ansi==3)
  227.       in_ansi=0;
  228.   }
  229.   gtitle=0;                                         /* Color Titles */
  230.   if (hangup)
  231.     s[0] = 0;
  232. }
  233.  
  234. End of additional void
  235.  
  236. Strings to add:
  237. 972-Enter to use current title, [Ctrl-Z] to abort.
  238. 973-Enter to Abort.
  239.  
  240.  
  241. Optional:
  242. Add 'gtitle' to the list of int's declared in VARS.H, and 'make fcns'.  Then
  243. go up to 'void input1' in COM.C, and make the changes there that have been
  244. commented in 'void titlein' with /* Color Titles */.  This will allow color
  245. titles for messages that are NOT responding to another message.
  246.  
  247. Any questions?  Just send me E-mail, and I'll get a reply right back to ya.
  248.  
  249. Disclaimer:
  250.   I didn't make you install this mod (though I'd like to <g>).
  251.  
  252.